home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / gfx / edit / AmiCAD_2.07.lha / AmiCAD / ARexx / Souligner.AmiCAD < prev    next >
Text File  |  2000-11-12  |  2KB  |  57 lines

  1. /* Soulignement d'un ou plusieurs textes
  2.     Version 1.00: 17 septembre 1998
  3.     Version 1.01: 14 avril 2000 (adaptation version 2.05)
  4.     Version 1.02: 11 novembre 2000 (localisation anglais/français)
  5. $VER: Souligner 1.02 (© R.Florac, 11 novembre 2000) */
  6.  
  7. options results
  8.  
  9. signal on error
  10. signal on syntax
  11.  
  12. 'LANGUAGE'
  13. if result="français.language" then fr=1
  14. else fr=0
  15.  
  16. 'OBJECTS'; objets=result
  17. if objets=0 then do
  18.     if fr=1 then 'MESSAGE("Il n''y a aucun objet"+CHR(10)+"sur ce schéma !")'
  19.     else 'MESSAGE("There is no object"+CHR(10)+"on the document !")'
  20.     exit
  21. end
  22.  
  23. objets=0
  24. 'SAVEALL:FIRSTSEL'; i=result
  25. do while i>0
  26.     objets = objets + souligner(i)
  27.     'NEXTSEL('i')'; i=result
  28. end
  29. if objets=0 then do
  30.     if fr=1 then 'PICKOBJ("Sélectionnez le texte à souligner")'
  31.     else 'PICKOBJ("Select the text to underline")'
  32.     i=result
  33.     if i>0 then call souligner(i)
  34. end
  35. exit
  36.  
  37. souligner: procedure
  38.     parse arg i
  39.     'TYPE(O__='i')'; type=result
  40.     if type = 4 | type = 5 | type = 6 then do
  41.     'DRAW(COL(O__),LINE(O__)+1,COL(O__)+WIDTH(O__)+1,LINE(O__)+1)'
  42.     return 1
  43.     end
  44. return 0
  45.  
  46. /* Traitement des erreurs, interruption du programme */
  47. syntax:
  48. erreur=RC
  49. if fr=1 then 'MESSAGE("Script Souligner.AmiCAD"+CHR(10)+"Erreur de syntaxe"+CHR(10)+"en ligne 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
  50. else 'MESSAGE("Souligner.AmiCAD script"+CHR(10)+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
  51. exit
  52.  
  53. error:
  54. if fr=1 then 'MESSAGE("Script Souligner.AmiCAD"+CHR(10)+"Erreur en ligne 'SIGL'")'
  55. else 'MESSAGE("Souligner.AmiCAD script"+CHR(10)+"Error in line 'SIGL'")'
  56. exit
  57.